.TH std::experimental::promise(libraryfundamentalsTS) 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::experimental::promise(libraryfundamentalsTS) \- std::experimental::promise(libraryfundamentalsTS)

.SH Synopsis
   Defined in header <experimental/future>
   template< class R > class promise;       \fB(1)\fP (library fundamentals TS)
   template< class R > class promise<R&>;   \fB(2)\fP (library fundamentals TS)
   template<>          class promise<void>; \fB(3)\fP (library fundamentals TS)

   std::experimental::fundamentals_v1::promise (and
   std::experimental::fundamentals_v2::promise) is a modified version of std::promise
   provided by the library fundamentals TS with support for type-erased allocators.

.SH Member types

   Member type    Definition
   allocator_type std::experimental::erased_type

.SH Member functions

   constructor         constructs the promise object
                       \fI(public member function)\fP
                       retrieves a pointer to the memory resource used by this object
   get_memory_resource to allocate memory
                       \fI(public member function)\fP

   Non-member function

   std::experimental::swap(std::experimental::promise) specializes the swap algorithm
                                                       \fI(function template)\fP

.SH Helper classes

                                                   specializes the std::uses_allocator
   std::uses_allocator<std::experimental::promise> type trait
                                                   \fI(class template specialization)\fP


Members identical to std::promise

.SH Member functions

   destructor                   destructs the promise object
                                \fI(public member function of std::promise<R>)\fP
   operator=                    assigns the shared state
                                \fI(public member function of std::promise<R>)\fP
   swap                         swaps two promise objects
                                \fI(public member function of std::promise<R>)\fP
.SH Getting the result
   get_future                   returns a future associated with the promised result
                                \fI(public member function of std::promise<R>)\fP
.SH Setting the result
   set_value                    sets the result to specific value
                                \fI(public member function of std::promise<R>)\fP
                                sets the result to specific value while delivering the
   set_value_at_thread_exit     notification only at thread exit
                                \fI(public member function of std::promise<R>)\fP
   set_exception                sets the result to indicate an exception
                                \fI(public member function of std::promise<R>)\fP
                                sets the result to indicate an exception while
   set_exception_at_thread_exit delivering the notification only at thread exit
                                \fI(public member function of std::promise<R>)\fP
